package com.ytlz.dmcs.model.system.entity;

import java.util.List;

import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.PersistenceConstructor;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.DBRef;
import org.springframework.data.mongodb.core.mapping.Document;

@Document(collection="sys_object")
public class SysObject {
	@Id
	private String id;
	
	@Indexed(unique = true)
	private String name;
	
	private String label;
	
	private String type;
	
	@DBRef
	private List<SysField> fields;

	@PersistenceConstructor
	public SysObject(String name,String label,String type) {
		this.name= name;
		this.label= label;
		this.type= type;
	}
	
	@PersistenceConstructor
	public SysObject(String name,List<SysField> fields) {
		this.name= name;
		this.fields = fields;
	}
	
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	public List<SysField> getFields() {
		return fields;
	}

	public void setFields(List<SysField> fields) {
		this.fields = fields;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
	
	
}
